package com.ruoyi.logistic.service.impl;

import com.ruoyi.logistic.domain.NetworkExamineList;
import com.ruoyi.logistic.mapper.NetworkExamineListMapper;
import com.ruoyi.logistic.service.NetworkExamineListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NetworkExamineListServiceImpl implements NetworkExamineListService {
    @Autowired
    private NetworkExamineListMapper networkExamineListMapper;
    @Override
    public List<NetworkExamineList> selectAll() {
        List<NetworkExamineList> networkExamineLists = networkExamineListMapper.selectAll();
        for (NetworkExamineList networkExamineList : networkExamineLists){
            List<NetworkExamineList> networkExamineLists1 = networkExamineListMapper.findTwoLevel(networkExamineList.getId());
            networkExamineList.setNetworkExamineLists(networkExamineLists1);
        }
        return networkExamineLists;
    }

    @Override
    public Boolean insert(NetworkExamineList networkExamineList) {
        return networkExamineListMapper.insert(networkExamineList);
    }

    @Override
    public Boolean update(NetworkExamineList networkExamineList) {
        return networkExamineListMapper.update(networkExamineList);
    }

    @Override
    public Boolean deleteById(Integer id) {
        return networkExamineListMapper.deleteById(id);
    }
}
